import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}

export function getData(params) {
  return request({
    url: '/user/search',
    params: params
  })
}

// export function getUser(userId) {
//   return request({
//     url: '/user/search',
//     method: 'get'
//   })
// }

export function delUser(userId) {
  return request({
    url: 'user/“' + userId + '"/delete',
    method: 'post',
    data: userId
  })
}
export function addUser(data) {
  return request({
    url: '/user/add',
    method: 'post',
    data
  })
}

// 修改用户
export function updateUser(data) {
  return request({
    url: '/user/edit',
    method: 'post',
    data
  })
}

